home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 186 / mag3 / blit.s < prev    next >
Text File  |  1985-05-29  |  1KB  |  39 lines

  1.  
  2.  ; Assembly Custom BITBLiT Routine
  3.  
  4.  ; a0 initially contains the physical screen's address.
  5.  ; a1=the address where the "GET" snapshot is stored.
  6.  
  7.  ; This program is merged with a GFA program as Data statements
  8.  ; ,and then read into a string.  It is called with the...
  9.  
  10.  ; Void C:Assembly_strings_address(L:Phys_adr,L:Get_adr+6)
  11.  
  12.  ; The way GFA stores the Get bitblock in memory caused me a lot of
  13.  ; grief.  Essentially, 16 bytes are stored and then 4 null bytes
  14.  ; are stored.  To obtain the correct bitmap these bytes have to be
  15.  ; taken into account when reading the GET string from memory.
  16.  
  17.      text
  18.      movea.l  4(sp),a0  ; Obtain the physical screen's address & the
  19.      movea.l  8(sp),a1  ; address where the GET bitblock is stored.
  20.  
  21.      add.l    #12920,a0  ; Now a0 contains the starting address
  22.                          ; of the destination block.
  23.  
  24.      move.w   #50,d1     ; This does the actual work...
  25. L1:  move.w   #15,d2       ; The destination block is 16 bytes wide
  26. L2:  move.b   (a1)+,(a0)+  ; by 51 rows.
  27.      dbra     d2,L2
  28.      add.l    #4,a1      ; This is necessary to skip the null bytes
  29.                          ; that GFA stores in the GET bitblock.
  30.      add.l    #144,a0    ; Line offset
  31.      dbra     d1,L1
  32.  
  33.      rts                 ; Return to GFA Basic
  34.  
  35.      end
  36.  
  37.  
  38.